package com.bytz.modules.cms.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bytz.modules.cms.order.entity.OrderOfflinePay;
import com.bytz.modules.cms.order.entity.OrderPayDetail;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 莱宝CMS—订单管理-订单线下支付信息表 服务类
 * </p>
 *
 * @author KyleWang
 * @since 2022-10-10
 */
public interface IOrderOfflinePayService extends IService<OrderOfflinePay> {

    /**
     * 通过id集合查询
     */
    List<OrderOfflinePay> getByIds(Collection<String> ids);

    /**
     * 检查是否可支付
     */
    void checkCanPay(List<OrderOfflinePay> orderOfflinePays);

    /**
     * 锁定线下支付
     */
    void lockOfflinePays(List<OrderOfflinePay> offlinePays);

    /**
     * 提交支付
     * @param offlinePayDetails 支付明细
     */
    void submitPay(List<OrderPayDetail> offlinePayDetails);

    /**
     * 提交支付
     * @param offlinePayDetails 支付明细
     */
    @Transactional(rollbackFor = Exception.class)
    void submitPay(List<OrderPayDetail> offlinePayDetails, List<OrderOfflinePay> offlinePays);

    /**
     * 释放汇票
     * @param offlinePayDetails 支付明细
     */
    void releaseOfflinePay(List<OrderPayDetail> offlinePayDetails);
}
